all=main

lib=login-widget.o input-field.o service.o string-util.o main-program.o function-list.o
cflags=-g -Wall
gflags=`pkg-config --cflags --libs gtk+-3.0`
pqflags=-I/usr/include/postgresql -lpq

allflags=$(cflags) $(gflags) $(pqflags)

#start here
all: $(all)

#main
main: main.c $(lib)
	cc main.c -o main $(lib) $(allflags)

#library
login-widget.o: login-widget.h login-widget.c
	cc login-widget.c -c $(cflags) $(gflags) $(pqflags)

input-field.o: input-field.h input-field.c
	cc input-field.c -c $(cflags) $(gflags)

service.o: service.h service.c
	cc service.c -c $(cflags) $(pqflags)

string-util.o: string-util.h string-util.c
	cc string-util.c -c $(cflags)

main-program.o: main-program.h main-program.c
	cc main-program.c -c $(cflags) $(gflags) $(pqflags)

function-list.o: function-list.c function-list.h
	cc function-list.c -c $(cflags) $(gflags)

#clean
clean:
	rm $(all) $(lib) -rRf
